package com.arges.controller;

import com.arges.pojo.Book;

import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * TODO
 * </p>
 *
 * @author GuiChen
 * @date 2022/11/24 024
 */
public class Test5 {

    //tokenKey
    private static final String TOKEN_KEY = "ARGES";

    public static void main(String[] args) throws Exception {
        long start = System.currentTimeMillis();
        List<String> list = new ArrayList<>();
        int count = 0 ;
        for (int i = 0; i < 1000; i++) {
            list.add("a_"+count);
            count++;

        }
        list.parallelStream().forEach(item -> {
//        list.parallelStream().forEachOrdered(item -> {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            System.out.println("item = " + item);
        });
//        for (String s : list) {
//            Thread.sleep(100);
//            System.out.println("item = " + s);
//        }
        long end = System.currentTimeMillis();
        System.out.println("总时间 = " + (end - start));

    }


}
